import request from '@/utils/request'

const api_order = '/orderService/order'
const api_pay = '/orderService/payLog'
export default {
  //创建订单
  createOrder(courseId) {
    return request({
      url: `${api_order}/createOrder/${courseId}`,
      method: 'post'
    })
  },
  //根据订单号获取订单信息
  getOrderById(orderNo) {
    return request({
      url: `${api_order}/getOrderByOrderNo/${orderNo}`,
      method: 'get'
    })
  },
  //根据订单号生成支付二维码
  createPayCode(orderNo) {
    return request({
      url: `${api_pay}/createPayCode/${orderNo}`,
      method: 'get'
    })
  },
  //根据订单号查询订单支付状态
  queryPayStatus(orderNo) {
    return request({
      url: `${api_pay}/queryPayStatus/${orderNo}`,
      method: 'get'
    })
  }
}
